package gRPC

import (
	"api-getway/global"
	pb "api-getway/internal/pb"
	doctor "api-getway/internal/pb/doctor"
	"fmt"
	"google.golang.org/grpc"
)

func UserClient() {
	// 1.连接
	conn, err := grpc.Dial("127.0.0.1:50051", grpc.WithInsecure())
	if err != nil {
		fmt.Printf("连接异常： %s\n", err)
	}
	// 2. 实例化gRPC客户端
	global.UserClient = pb.NewUserClient(conn)
}
func DoctorClient() {
	// 1.连接
	conn, err := grpc.Dial("127.0.0.1:50052", grpc.WithInsecure())
	if err != nil {
		fmt.Printf("连接异常： %s\n", err)
	}
	// 2. 实例化gRPC客户端
	global.DoctorClient = doctor.NewDoctorClient(conn)
}
